home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: A little more explanation
- Date: 23 Mar 1996 09:45 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <23MAR199609455524@erich.triumf.ca>
- References: <4iskkm$guk@cti01.citenet.net> <4isl5t$guk@cti01.citenet.net> <4j1018$r6i@cti01.citenet.net>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4j1018$r6i@cti01.citenet.net>, kabir@citenet.net (larry mintz) writes...
- >
- >I have the following data in a file called log.dat.It represents the login/out
- >times of people on a network: The fields are
- > NAME LOGIN_TIME LOGOUT_TIME PORT
- > urstupid 5:30:12 6:00:00 25
-
- >The structure I am using is
- > struct xx{ char NAME[10];
- >> char LOGIN_TIME[10];
- > char LOGOUT_TIME[10];
- > unsigned PORT:5;
- > };
-
- >Question: How do I load log.dat into the struct LOGTABLE[10] so all the data
- >is in the proper fields?
-
- Try reading a line with fgets(), then separate the pieces with strtok(),
- sscanf(), or otherwise. Perhaps strncpy(), if the fields are of fixed width.
-
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-
-
-
-
-
-
-
-